﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SM_RoleList.aspx.cs" Inherits="ZLDC.Estate.TM.SM_RoleList" Theme="NewSkin"%>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head id="Head1" runat="server">
    <title>角色管理</title>
    <link href="../../cssnew/page.css" rel="stylesheet" type="text/css" />
    <style>
        a
        {
            color: blue;
            text-decoration: none;
        }
        a:hover
        {
            color: blue;
            text-decoration: underline;
        }
        a:visited
        {
            color: blue;
            text-decoration: none;
        }
    </style>

    <script language="javascript"> 
   <!--
        var bColor = '#ff3300'; //定义颜色,为单击时显示的颜色 
        var fColor = '#fafafa'; //定义颜色,为单击时字体所显示的颜色 
        function tdOver(td) {
            if (td.style.backgroundColor != bColor)//当这一列的背景颜色不为以上定义的颜色时 
            {
                td.setAttribute('DtBg', td.style.backgroundColor); //得到这列的背景颜色并且设置为DtBg 
                td.setAttribute('DtCo', td.style.color); //得到这列的字体颜色并且设置为DtCo 

                td.style.color = '#ff66cc'; //设置鼠标移上时列里的字体颜色为#ff99ff 
                td.style.cursor = 'hand'; //设置鼠标的形状为手状 
                td.style.backgroundColor = '#66cc66'; //设置该列的背景颜色为#66cc66 
            }
        }

        function tdOut(td) {
            if (td.style.backgroundColor != bColor)//当这一列的背景颜色不为以上定义的颜色时 
            {
                td.style.backgroundColor = td.getAttribute('DtBg'); //设置该列的背景颜色为以上得到的颜色,即DtBg 
                td.style.color = td.getAttribute('DtCo'); //设置该列的背景颜色为以上得到的颜色,即DtCo 
            }
        }

        function clearTdColor(tdc) {
            var tdColl = document.all.tags('TR'); //得到所有的行 
            bc = tdc.getAttribute('Dtbg'); //得到该列的背景颜色(在tdOver方法中setAttribute) 
            cc = tdc.getAttribute('DtCo'); //得到该列的字体颜色(在tdOver方法中setAttribute) 
            for (i = 0; i < tdColl.length; i++)//循环行 
            {
                whichTD = tdColl(i); //得到当前的行 
                if (whichTD.style.backgroundColor == bColor)//如果该单元格为开始时设置的颜色,即bColor 
                {
                    //说明:如果你的DataGrid不分普通列和交替列,则使用以下代码,清除颜色 

                    //如果你的DataGrid分普通列和交替列,而且交替列有颜色,则使用以下代码,清除颜色 
                    //提示:使用的时候注意一下以下的判断,根据自己的实际情况取模判断可能要交换一下. 
                    if (i % 2 != 0) //表示是普通列,因为没有颜色,所以下面的颜色为"" 
                    {
                        whichTD.style.backgroundColor = "";
                        whichTD.style.color = "";
                        whichTD.style.fontWeight = '';
                        break;
                    }
                    else   //表示是交替列,根据你的DataGrid交替列的颜色而设置下面的backgroundColor 
                    {
                        whichTD.style.backgroundColor = ""; //#CCFFFF为设置的DataGrid交替项的颜色(可以根据自己的需要修改) 
                        whichTD.style.color = "";
                        whichTD.style.fontWeight = '';
                        break;
                    }
                }
            }
        }

        function tdColor(tdc) {
            clearTdColor(tdc); //首先清楚所有的颜色 
            bc = tdc.getAttribute('Dtbg'); //得到该列的背景颜色(在tdOver方法中setAttribute) 
            cc = tdc.getAttribute('DtCo'); //得到该列的字体颜色(在tdOver方法中setAttribute) 
            tdcs = tdc.style.backgroundColor; //得到该列当前的颜色(即鼠标移至单元格时的颜色) 
            if (event.srcElement.tagName != 'A')//event.srcElement.tagName就是触发的单元格的名称,即TD 
            {
                if (tdcs != bColor)//如果该列的当前颜色不等于开始是定义的颜色时 
                {
                    tdc.style.backgroundColor = bColor; //设置背景颜色为开始定义的颜色 
                    tdc.style.color = fColor; //设置背景颜色为开始定义的字体颜色 
                    tdc.style.fontWeight = '500';
                }
                else {
                    tdc.style.backgroundColor = bc; //设置背景颜色(为在tdOver方法中setAttribute) 
                    tdc.style.color = cc; //设置背景颜色为(在tdOver方法中setAttribute) 
                    tdc.style.fontWeight = '';
                }
            }
        }

        function tdColorDbl(tdc)//清除该列的颜色 
        {
            clearTdColor(tdc);
        }


        //打开模式对话框,strUrl为打开的带路径的URL,InValue为要传入的值

        function OpenModelessDialog(strUrl, InValue, strWidth, strHeight, sFeatures) {
            var strFeatures;
            if (typeof (sFeatures) == "undefined")
                strFeatures = "dialogWidth=" + strWidth + "px;dialogHeight=" + strHeight
                + "px;resizable:no;scrollbars:yes;center:yes;help:no;status:no";
            else
                strFeatures = "dialogWidth=" + strWidth + "px;dialogHeight=" + strHeight + "px;" + sFeatures;

            var sValue = showModalDialog(strUrl, InValue, strFeatures);
            return sValue;
        }
   --> 
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="hbNav">
        <div id="navLeft">
                <img src="../images/zlTitle.gif" width="13" align="absmiddle" />&nbsp;&nbsp;当前功能<span
                class="hbdot">&raquo;</span>角色查询列表</div>
        <div id="navRght">
       
        </div>
    </div>
    <fieldset class="mainField">
        <div id="dvTable">
            <table border="0" cellpadding="1" cellspacing="1" width="98%">
                <tr>
                    <td nowrap="nowrap" style="background-color: #efefef" width="20%" align="right">
                        角色名称：

                    </td>
                    <td class="searchTxt" width="30%">
                        &nbsp;<input type="text" id="txtRoleName" class="textdocdown" runat="server" style="width: 70%" />
                    </td>
                    <td nowrap="nowrap" style="background-color: #efefef" width="20%" align="right">
                        描述：

                    </td>
                    <td class="searchTxt" width="30%">
                        &nbsp;<input type="text" id="txtRoleDsc" class="textdocdown" runat="server" style="width: 70%" />
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                     <asp:Button ID="Button2" runat="server" Text=" 查 询 " class="button_bak" OnClick="Button2_Click" />
                            &nbsp;<asp:Button ID="btnAdd" runat="server" Text=" 新 增 " class="button_bak" OnClick="btnAdd_Click" />
                    </td>
                </tr>
            </table>

            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <table border="1" cellpadding="1" cellspacing="1" class="datagrid-style" style="width: 100%">
                            <tr class="datagrid-headerstyle">
                                <td class="datagrid-headercolor" align="center">
                                    <b>NO.</b>
                                </td>
                                <td class="datagrid-headercolor" align="center">
                                    <b>序号</b>
                                </td>
                                <td class="datagrid-headercolor" align="center">
                                    <b>角色编码</b>
                                </td>
                                <td class="datagrid-headercolor" align="center">
                                    <b>角色名称</b>
                                </td>
                                <td class="datagrid-headercolor" align="center">
                                    <b>描述</b>
                                </td>
                                <td class="datagrid-headercolor">
                                </td>
                                <td class="datagrid-headercolor">
                                </td>
                                <td class="datagrid-headercolor">
                                </td>
                                <td class="datagrid-headercolor">
                                </td>
                                <td class="datagrid-headercolor">
                                </td>
                            </tr>
                            <asp:DataList ID="dlistData" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal"
                                DataKeyField="id" OnItemCommand="dlistData_ItemCommand" OnItemDataBound="dlistData_ItemDataBound"
                                CellPadding="0" CellSpacing="0">
                                <ItemTemplate>
                                    <tr id="trList" runat="server">
                                        <td class="datagrid-style" style="width: 30px;" align="center">
                                            <%# Eval("Row")%>
                                        </td>
                                        <td class="datagrid-style" style="width: 60px;" align="center">
                                            <%# Eval("id")%>
                                        </td>
                                        <td class="datagrid-style" style="width: 150px;">
                                            <%# Eval("RoleCode")%>
                                        </td>
                                        <td class="datagrid-style" style="width: 150px;">
                                            <%# Eval("name")%>
                                            <input type="hidden" id="txtHidName" runat="server" value='<%# Eval("name")%>' />
                                        </td>
                                        <td class="datagrid-style">
                                            <%# Eval("dsc")%>
                                        </td>
                                        <td class="datagrid-style" style="width: 80px;" align="center">
                                            <a href='#' onclick="OpenModelessDialog('SM_RoleEmployee.aspx?Roleid=<%#Eval("id")%>','Employee',750,600);">
                                                成员管理</a>
                                        </td>
                                        <td class="datagrid-style" style="width: 80px;" align="center">
                                            <div id="dvAccredit" runat="server">
                                                <a href='SM_Accredit.aspx?RoleID=<%#Eval("id")%>'>分配权限</a></div>
                                        </td>
                                        <td class="datagrid-style" style="width: 50px;" align="center">
                                            <div id="dvEdit" runat="server">
                                                <a href='SM_RoleEdit.aspx?RoleID=<%#Eval("id")%>'>修改</a></div>
                                        </td>
                                        <td class="datagrid-style" style="width: 50px;" align="center">
                                            <asp:LinkButton ID="btnDelete" CommandName="delete" runat="server" Text="删除" CommandArgument='<%#Eval("id")%>'></asp:LinkButton>
                                        </td>
                                        <td class="datagrid-style" style="width: 50px;" align="center">
                                            <asp:LinkButton ID="btnCopy" CommandName="Copy" runat="server" Text="复制" CommandArgument='<%#Eval("id")%>'></asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:DataList></table>
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator" SubmitButtonText="跳转"
                            Height="22px" Width="100%" ShowPageIndexBox="Always" HorizontalAlign="Right"
                            AlwaysShow="True" OnPageChanging="AspNetPager1_PageChanging" PageIndexBoxClass="pageTextBox"
                            SubmitButtonClass="ibutton" SubmitButtonStyle="" CustomInfoTextAlign="Left" LayoutType="Table"
                            ShowCustomInfoSection="Left" PageSize="15" FirstPageText="首页" LastPageText="末页"
                            NextPageText="下一页" PrevPageText="上一页">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
        </div>
    </fieldset>
    </form>
</body>
</html>

